import os
from dotenv import load_dotenv, find_dotenv
load_dotenv(find_dotenv())

# load from env
REQUEST_SHEET_TOKEN = os.getenv("CUSTOMER_REQUEST_SHEET_TOKEN")
APP_ID = os.getenv("APP_ID")
APP_SECRET = os.getenv("APP_SECRET")
LARK_HOST = os.getenv("LARK_HOST")
APP_TOKEN = os.getenv("APP_TOKEN")
PRODUCT_INFO_TABLE_ID = os.getenv("PRODUCT_INFO_TABLE_ID")
PRODUCT_STATEMENT_TABLE_ID = os.getenv("PRODUCT_STATEMENT_TABLE_ID")

TEST_REPORT_TABLE_ID = os.getenv("TEST_REPORT_TABLE_ID")
TEST_REPORT_VIEW_ID = os.getenv("TEST_REPORT_VIEW_ID")

PRODUCT_INFO_COA_VIEW_ID = os.getenv("PRODUCT_INFO_COA_VIEW_ID")
COA_TARGET_TABLE_ID = os.getenv("COA_TARGET_TABLE_ID")
COA_TARGET_VIEW_ID = os.getenv("COA_TARGET_VIEW_ID")

# COA_FOLDER_TOKEN
VF_FOLDER_TOKEN = os.getenv("VF_FOLDER_TOKEN")
SR_FOLDER_TOKEN = os.getenv("SR_FOLDER_TOKEN")
NC_FOLDER_TOKEN = os.getenv("NC_FOLDER_TOKEN")
PB_FOLDER_TOKEN = os.getenv("PB_FOLDER_TOKEN")
FI_FOLDER_TOKEN = os.getenv("FI_FOLDER_TOKEN")
RA_FOLDER_TOKEN = os.getenv('RA_FOLDER_TOKEN')
COA_FOLDER_TOKEN = os.getenv("COA_FOLDER_TOKEN")

folder_token = {'COA': COA_FOLDER_TOKEN,
                'VF': VF_FOLDER_TOKEN,
                'SR': SR_FOLDER_TOKEN,
                'SO': SR_FOLDER_TOKEN,
                'NC': NC_FOLDER_TOKEN,
                'NT': NC_FOLDER_TOKEN,
                'CF': NC_FOLDER_TOKEN,
                'NX': NC_FOLDER_TOKEN,
                'PB': PB_FOLDER_TOKEN,
                'FI': FI_FOLDER_TOKEN,
                'FX': FI_FOLDER_TOKEN,
                'RA': RA_FOLDER_TOKEN}

# localization

DOC_TYPE_DICT = {'COA': 'Certificate of Analysis',
                 "COA Template": "Certificate of Analysis",
                 'MSDS EU': 'Material Safety Data Sheet',
                 'MSDS US': 'Material Safety Data Sheet',
                 'Specification': 'Specification',
                 'Nutrition Facts': 'Nutrition Facts',
                 "Product Statement": "Product Statement"}

if os.getenv("LOCAL_TIMEZONE"):
    LOCAL_TIMEZONE = os.getenv("LOCAL_TIMEZONE")
else:
    LOCAL_TIMEZONE = "Asia/Shanghai"

TEMPLATE_PATH = '.\\data\\template'
SAVE_PATH = ".\\BKD Product"
DATA_PATH = '.\\data'
COA_PATH ='.\\COA'
ROBIN_SIGN = os.path.join(DATA_PATH, 'Robin_sign.png')

if __name__ == "__main__":
    print(SAVE_PATH)
    print(TEMPLATE_PATH)
    print(DATA_PATH)

